/**
* File:FormMain.h 
* This is the main form class file that defines the overall look of JP Timer.
* Definitions of countdown timer and stopwatch in this file.
*
* Copyright (c) 2008, J PENG
* All rights reserved.
**/

#pragma once

namespace PJJTimer {

	using namespace PJJTimer;
	using namespace System;
	using namespace System::IO;
	using namespace System::Reflection;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for FormMain
	///
	/// FormMain provides the detailed definitions for countdown timer and stopwatch.
	/// It is the central form class for the project.
	/// </summary>
	public ref class FormMain : public System::Windows::Forms::Form
	{
	public:
		FormMain(void)
		{
			InitializeComponent();
			timeSelector = gcnew TimeSelector;

			//Initialize stopwatch variables
			this->stopWatch = gcnew System::Diagnostics::Stopwatch;
			this->stopwatchLapCollection = gcnew StopwatchLAP();
			//this->watchTimer = gcnew Timers::Timer(100);
			//this->watchTimer->Elapsed += gcnew Timers::ElapsedEventHandler(this,&FormMain::StopwatchOnTimedEvent);
			//this->watchTimer->Enabled = true;
			//this->watchTimer->Stop();

			this->flashing = 0;
			this->CaptureTimeStamp();
			this->PrintTimeStamp();

			//Initialize sound player
			Assembly ^assem = Assembly::GetExecutingAssembly();
			this->wavPlayer = gcnew System::Media::SoundPlayer(assem->GetManifestResourceStream(L"camera_shutter_sound.wav"));
			//Initialize reusable images
			this->imagePlayMusic = gcnew Bitmap(assem->GetManifestResourceStream(L"play_music.png"));
			this->imageShutdown = gcnew Bitmap(assem->GetManifestResourceStream(L"shutdown.png"));
			this->imageLogoff = gcnew Bitmap(assem->GetManifestResourceStream(L"logoff.png"));
			this->imageReboot = gcnew Bitmap(assem->GetManifestResourceStream(L"reboot.png"));
			this->imageBackground = nullptr;
			InitializeReusableImages();

			//Load and initialize settings
			this->LoadSettings();
			if(language != Languages::English) SetLanguages();
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~FormMain()
		{
			if (components)
			{
				delete components;
			}
		}

	private: System::Windows::Forms::Timer^  timer;
	private: System::ComponentModel::IContainer^  components;

	private:
		int startCount;
		int countdownSeconds;
		int flashing;
		DateTime timeStamp; //time stamp for timer
		TimeSpan swtime; //Variable to store temporary stopwatch elapsed time value
		StopwatchLAP ^stopwatchLapCollection;
		System::Diagnostics::Stopwatch ^stopWatch;
		//Timers::Timer ^watchTimer;

		TimeSelector ^timeSelector;
		System::Media::SoundPlayer ^wavPlayer;
		String ^musicInfo;
		int alarmOnAction;

		//Reusable images
		Bitmap ^imagePlayMusic;
		Bitmap ^imageShutdown;
		Bitmap ^imageLogoff;
		Bitmap ^imageReboot;
		Bitmap ^imageBackground;

	private: System::Windows::Forms::ContextMenuStrip^  timerContextMenu;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_SetTime;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_About;
	private: System::Windows::Forms::TabControl^  tabControl;
	private: System::Windows::Forms::TabPage^  tab_timer;
	private: System::Windows::Forms::TabPage^  tab_stopwatch;
	public: System::Windows::Forms::Label^  display;
	public: System::Windows::Forms::Label^  stopwatchDisplay;
	private: AxWMPLib::AxWindowsMediaPlayer^  WMPlayer;
	private: System::Windows::Forms::ToolTip^  tooltips;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_StopCountdown;
	public: System::Windows::Forms::ImageList^  imageset;
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_Options;
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_ShowAlarmMusicInfo;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_SetAlarmMusic;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_SetAlarmOnAction;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_PlayMusic;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_ShutdownWindows;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_LogoffWindows;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_RebootWindows;
	private: System::Windows::Forms::NotifyIcon^  notifyIcon;
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_Exit;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_ShowTimer;
	private: System::Windows::Forms::ToolStripSeparator^  showTimerSeparator;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_timestampDisplay;
	private: System::Windows::Forms::ToolStrip^  timerMenuBar;
	private: System::Windows::Forms::ToolStripButton^  menuBarAddMusic;
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator4;
	private: System::Windows::Forms::ToolStripButton^  menuBarPlayPause;
	private: System::Windows::Forms::ToolStripButton^  menuBarStop;
	private: System::Windows::Forms::ToolStripButton^  menuBarSetTime;
	private: System::Windows::Forms::ToolStripLabel^  filename_display;
	private: System::Windows::Forms::ToolStripDropDownButton^  menuBarAlarmOnAction;
	private: System::Windows::Forms::ToolStripMenuItem^  menuBarPlayMusic;
	private: System::Windows::Forms::ToolStripMenuItem^  menuBarShutdownWindows;
	private: System::Windows::Forms::ToolStripMenuItem^  menuBarLogoffWindows;
	private: System::Windows::Forms::ToolStripMenuItem^  menuBarRebootWindows;
	private: System::Windows::Forms::ToolStrip^  stopwatchMenuBar;
	private: System::Windows::Forms::ToolStripButton^  menuBarStopwatchViewLAP;
	private: System::Windows::Forms::ToolStripButton^  menuBarStopwatchCamera;
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator5;
	private: System::Windows::Forms::ToolStripButton^  menuBarStopwatchPlayPause;
	private: System::Windows::Forms::ToolStripButton^  menuBarStopwatchStop;
	private: System::Windows::Forms::ContextMenuStrip^  stopwatchContextMenu;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItemStopwatchOptions;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItemStopwatchAbout;
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator9;
	private: System::Windows::Forms::ToolStripMenuItem^  menuItemStopwatchExit;
	private: System::Windows::Forms::Timer^  watchTimer;
private: System::Windows::Forms::ToolStripMenuItem^  menuItem_help;
private: System::Windows::Forms::ToolStripMenuItem^  menuItemStopwatchHelp;


	private: System::Windows::Forms::ToolStripMenuItem^  menuItem_ShowTimestamp;


#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->components = (gcnew System::ComponentModel::Container());
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(FormMain::typeid));
			this->timer = (gcnew System::Windows::Forms::Timer(this->components));
			this->timerContextMenu = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
			this->menuItem_ShowTimer = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->showTimerSeparator = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuItem_SetTime = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_SetAlarmMusic = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_SetAlarmOnAction = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_PlayMusic = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_ShutdownWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_LogoffWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_RebootWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuItem_ShowAlarmMusicInfo = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_StopCountdown = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuItem_ShowTimestamp = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_timestampDisplay = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_Options = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_help = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItem_About = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuItem_Exit = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->tabControl = (gcnew System::Windows::Forms::TabControl());
			this->tab_timer = (gcnew System::Windows::Forms::TabPage());
			this->timerMenuBar = (gcnew System::Windows::Forms::ToolStrip());
			this->menuBarPlayPause = (gcnew System::Windows::Forms::ToolStripButton());
			this->menuBarStop = (gcnew System::Windows::Forms::ToolStripButton());
			this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuBarAddMusic = (gcnew System::Windows::Forms::ToolStripButton());
			this->menuBarSetTime = (gcnew System::Windows::Forms::ToolStripButton());
			this->filename_display = (gcnew System::Windows::Forms::ToolStripLabel());
			this->menuBarAlarmOnAction = (gcnew System::Windows::Forms::ToolStripDropDownButton());
			this->menuBarPlayMusic = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuBarShutdownWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuBarLogoffWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuBarRebootWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->display = (gcnew System::Windows::Forms::Label());
			this->imageset = (gcnew System::Windows::Forms::ImageList(this->components));
			this->WMPlayer = (gcnew AxWMPLib::AxWindowsMediaPlayer());
			this->tab_stopwatch = (gcnew System::Windows::Forms::TabPage());
			this->stopwatchContextMenu = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
			this->menuItemStopwatchOptions = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->menuItemStopwatchAbout = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->toolStripSeparator9 = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuItemStopwatchExit = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->stopwatchMenuBar = (gcnew System::Windows::Forms::ToolStrip());
			this->menuBarStopwatchPlayPause = (gcnew System::Windows::Forms::ToolStripButton());
			this->menuBarStopwatchStop = (gcnew System::Windows::Forms::ToolStripButton());
			this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
			this->menuBarStopwatchViewLAP = (gcnew System::Windows::Forms::ToolStripButton());
			this->menuBarStopwatchCamera = (gcnew System::Windows::Forms::ToolStripButton());
			this->stopwatchDisplay = (gcnew System::Windows::Forms::Label());
			this->tooltips = (gcnew System::Windows::Forms::ToolTip(this->components));
			this->notifyIcon = (gcnew System::Windows::Forms::NotifyIcon(this->components));
			this->watchTimer = (gcnew System::Windows::Forms::Timer(this->components));
			this->menuItemStopwatchHelp = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->timerContextMenu->SuspendLayout();
			this->tabControl->SuspendLayout();
			this->tab_timer->SuspendLayout();
			this->timerMenuBar->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->WMPlayer))->BeginInit();
			this->tab_stopwatch->SuspendLayout();
			this->stopwatchContextMenu->SuspendLayout();
			this->stopwatchMenuBar->SuspendLayout();
			this->SuspendLayout();
			// 
			// timer
			// 
			this->timer->Enabled = true;
			this->timer->Interval = 1000;
			this->timer->Tick += gcnew System::EventHandler(this, &FormMain::timer_Tick);
			// 
			// timerContextMenu
			// 
			this->timerContextMenu->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(15) {this->menuItem_ShowTimer, 
				this->showTimerSeparator, this->menuItem_SetTime, this->menuItem_SetAlarmMusic, this->menuItem_SetAlarmOnAction, this->toolStripSeparator1, 
				this->menuItem_ShowAlarmMusicInfo, this->menuItem_StopCountdown, this->toolStripSeparator2, this->menuItem_ShowTimestamp, this->menuItem_Options, 
				this->menuItem_help, this->menuItem_About, this->toolStripSeparator3, this->menuItem_Exit});
			this->timerContextMenu->Name = L"timerContextMenu";
			this->timerContextMenu->Size = System::Drawing::Size(186, 270);
			// 
			// menuItem_ShowTimer
			// 
			this->menuItem_ShowTimer->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_ShowTimer.Image")));
			this->menuItem_ShowTimer->Name = L"menuItem_ShowTimer";
			this->menuItem_ShowTimer->Size = System::Drawing::Size(185, 22);
			this->menuItem_ShowTimer->Text = L"Show Timer";
			this->menuItem_ShowTimer->Visible = false;
			this->menuItem_ShowTimer->Click += gcnew System::EventHandler(this, &FormMain::ShowTimer_Event);
			// 
			// showTimerSeparator
			// 
			this->showTimerSeparator->Name = L"showTimerSeparator";
			this->showTimerSeparator->Size = System::Drawing::Size(182, 6);
			this->showTimerSeparator->Visible = false;
			// 
			// menuItem_SetTime
			// 
			this->menuItem_SetTime->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_SetTime.Image")));
			this->menuItem_SetTime->Name = L"menuItem_SetTime";
			this->menuItem_SetTime->Size = System::Drawing::Size(185, 22);
			this->menuItem_SetTime->Text = L"Set Countdown &Time...";
			this->menuItem_SetTime->Click += gcnew System::EventHandler(this, &FormMain::SetCountDownTime_Click);
			// 
			// menuItem_SetAlarmMusic
			// 
			this->menuItem_SetAlarmMusic->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_SetAlarmMusic.Image")));
			this->menuItem_SetAlarmMusic->Name = L"menuItem_SetAlarmMusic";
			this->menuItem_SetAlarmMusic->Size = System::Drawing::Size(185, 22);
			this->menuItem_SetAlarmMusic->Text = L"Set Alarm &Music...";
			this->menuItem_SetAlarmMusic->Click += gcnew System::EventHandler(this, &FormMain::SetAlarmMusic_Click);
			// 
			// menuItem_SetAlarmOnAction
			// 
			this->menuItem_SetAlarmOnAction->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->menuItem_PlayMusic, 
				this->menuItem_ShutdownWindows, this->menuItem_LogoffWindows, this->menuItem_RebootWindows});
			this->menuItem_SetAlarmOnAction->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_SetAlarmOnAction.Image")));
			this->menuItem_SetAlarmOnAction->Name = L"menuItem_SetAlarmOnAction";
			this->menuItem_SetAlarmOnAction->Size = System::Drawing::Size(185, 22);
			this->menuItem_SetAlarmOnAction->Text = L"S&et Alarm-on Action";
			// 
			// menuItem_PlayMusic
			// 
			this->menuItem_PlayMusic->Name = L"menuItem_PlayMusic";
			this->menuItem_PlayMusic->Size = System::Drawing::Size(168, 22);
			this->menuItem_PlayMusic->Text = L"Play Music";
			this->menuItem_PlayMusic->Click += gcnew System::EventHandler(this, &FormMain::menuItem_PlayMusic_Click);
			// 
			// menuItem_ShutdownWindows
			// 
			this->menuItem_ShutdownWindows->Name = L"menuItem_ShutdownWindows";
			this->menuItem_ShutdownWindows->Size = System::Drawing::Size(168, 22);
			this->menuItem_ShutdownWindows->Text = L"Shutdown Windows";
			this->menuItem_ShutdownWindows->Click += gcnew System::EventHandler(this, &FormMain::menuItem_ShutDownWindows_Click);
			// 
			// menuItem_LogoffWindows
			// 
			this->menuItem_LogoffWindows->Name = L"menuItem_LogoffWindows";
			this->menuItem_LogoffWindows->Size = System::Drawing::Size(168, 22);
			this->menuItem_LogoffWindows->Text = L"Logoff Windows";
			this->menuItem_LogoffWindows->Click += gcnew System::EventHandler(this, &FormMain::menuItem_LogOffWindows_Click);
			// 
			// menuItem_RebootWindows
			// 
			this->menuItem_RebootWindows->Name = L"menuItem_RebootWindows";
			this->menuItem_RebootWindows->Size = System::Drawing::Size(168, 22);
			this->menuItem_RebootWindows->Text = L"Reboot Windows";
			this->menuItem_RebootWindows->Click += gcnew System::EventHandler(this, &FormMain::menuItem_RestartWindows_Click);
			// 
			// toolStripSeparator1
			// 
			this->toolStripSeparator1->Name = L"toolStripSeparator1";
			this->toolStripSeparator1->Size = System::Drawing::Size(182, 6);
			// 
			// menuItem_ShowAlarmMusicInfo
			// 
			this->menuItem_ShowAlarmMusicInfo->Checked = true;
			this->menuItem_ShowAlarmMusicInfo->CheckState = System::Windows::Forms::CheckState::Checked;
			this->menuItem_ShowAlarmMusicInfo->Name = L"menuItem_ShowAlarmMusicInfo";
			this->menuItem_ShowAlarmMusicInfo->Size = System::Drawing::Size(185, 22);
			this->menuItem_ShowAlarmMusicInfo->Text = L"Show Alarm Music &Info";
			this->menuItem_ShowAlarmMusicInfo->Click += gcnew System::EventHandler(this, &FormMain::menuItem_ShowAlarmMusicInfo_Click);
			// 
			// menuItem_StopCountdown
			// 
			this->menuItem_StopCountdown->Name = L"menuItem_StopCountdown";
			this->menuItem_StopCountdown->Size = System::Drawing::Size(185, 22);
			this->menuItem_StopCountdown->Text = L"&Stop Countdown";
			this->menuItem_StopCountdown->Click += gcnew System::EventHandler(this, &FormMain::menuItem_StopCountdown_Click);
			// 
			// toolStripSeparator2
			// 
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
			this->toolStripSeparator2->Size = System::Drawing::Size(182, 6);
			// 
			// menuItem_ShowTimestamp
			// 
			this->menuItem_ShowTimestamp->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->menuItem_timestampDisplay});
			this->menuItem_ShowTimestamp->Name = L"menuItem_ShowTimestamp";
			this->menuItem_ShowTimestamp->Size = System::Drawing::Size(185, 22);
			this->menuItem_ShowTimestamp->Text = L"Timestamp";
			// 
			// menuItem_timestampDisplay
			// 
			this->menuItem_timestampDisplay->Name = L"menuItem_timestampDisplay";
			this->menuItem_timestampDisplay->Size = System::Drawing::Size(67, 22);
			// 
			// menuItem_Options
			// 
			this->menuItem_Options->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_Options.Image")));
			this->menuItem_Options->Name = L"menuItem_Options";
			this->menuItem_Options->Size = System::Drawing::Size(185, 22);
			this->menuItem_Options->Text = L"&Options...";
			this->menuItem_Options->Click += gcnew System::EventHandler(this, &FormMain::menuItem_Options_Click);
			// 
			// menuItem_help
			// 
			this->menuItem_help->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_help.Image")));
			this->menuItem_help->Name = L"menuItem_help";
			this->menuItem_help->Size = System::Drawing::Size(185, 22);
			this->menuItem_help->Text = L"&Help";
			this->menuItem_help->Click += gcnew System::EventHandler(this, &FormMain::menuItem_help_Click);
			// 
			// menuItem_About
			// 
			this->menuItem_About->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_About.Image")));
			this->menuItem_About->Name = L"menuItem_About";
			this->menuItem_About->Size = System::Drawing::Size(185, 22);
			this->menuItem_About->Text = L"&About...";
			this->menuItem_About->Click += gcnew System::EventHandler(this, &FormMain::menuItem_About_Click);
			// 
			// toolStripSeparator3
			// 
			this->toolStripSeparator3->Name = L"toolStripSeparator3";
			this->toolStripSeparator3->Size = System::Drawing::Size(182, 6);
			// 
			// menuItem_Exit
			// 
			this->menuItem_Exit->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItem_Exit.Image")));
			this->menuItem_Exit->Name = L"menuItem_Exit";
			this->menuItem_Exit->Size = System::Drawing::Size(185, 22);
			this->menuItem_Exit->Text = L"E&xit";
			this->menuItem_Exit->ToolTipText = L"Exit the program";
			this->menuItem_Exit->Click += gcnew System::EventHandler(this, &FormMain::menuItem_Exit_Click);
			// 
			// tabControl
			// 
			this->tabControl->Appearance = System::Windows::Forms::TabAppearance::FlatButtons;
			this->tabControl->Controls->Add(this->tab_timer);
			this->tabControl->Controls->Add(this->tab_stopwatch);
			this->tabControl->Dock = System::Windows::Forms::DockStyle::Fill;
			this->tabControl->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->tabControl->ImageList = this->imageset;
			this->tabControl->Location = System::Drawing::Point(0, 0);
			this->tabControl->Name = L"tabControl";
			this->tabControl->RightToLeft = System::Windows::Forms::RightToLeft::No;
			this->tabControl->SelectedIndex = 0;
			this->tabControl->Size = System::Drawing::Size(294, 148);
			this->tabControl->TabIndex = 0;
			// 
			// tab_timer
			// 
			this->tab_timer->AllowDrop = true;
			this->tab_timer->BackColor = System::Drawing::SystemColors::Control;
			this->tab_timer->ContextMenuStrip = this->timerContextMenu;
			this->tab_timer->Controls->Add(this->timerMenuBar);
			this->tab_timer->Controls->Add(this->display);
			this->tab_timer->Controls->Add(this->WMPlayer);
			this->tab_timer->ImageKey = L"countdown_timer.png";
			this->tab_timer->Location = System::Drawing::Point(4, 26);
			this->tab_timer->Name = L"tab_timer";
			this->tab_timer->Padding = System::Windows::Forms::Padding(3);
			this->tab_timer->Size = System::Drawing::Size(286, 118);
			this->tab_timer->TabIndex = 0;
			this->tab_timer->Text = L"Timer";
			this->tab_timer->UseVisualStyleBackColor = true;
			this->tab_timer->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &FormMain::DragAndDropInMusicFile_Event);
			this->tab_timer->DragEnter += gcnew System::Windows::Forms::DragEventHandler(this, &FormMain::AllowDragDrop_DragEnter);
			// 
			// timerMenuBar
			// 
			this->timerMenuBar->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left));
			this->timerMenuBar->AutoSize = false;
			this->timerMenuBar->Dock = System::Windows::Forms::DockStyle::None;
			this->timerMenuBar->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(7) {this->menuBarPlayPause, 
				this->menuBarStop, this->toolStripSeparator4, this->menuBarAddMusic, this->menuBarSetTime, this->filename_display, this->menuBarAlarmOnAction});
			this->timerMenuBar->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::Flow;
			this->timerMenuBar->Location = System::Drawing::Point(0, 1);
			this->timerMenuBar->Name = L"timerMenuBar";
			this->timerMenuBar->RenderMode = System::Windows::Forms::ToolStripRenderMode::System;
			this->timerMenuBar->Size = System::Drawing::Size(285, 23);
			this->timerMenuBar->TabIndex = 15;
			// 
			// menuBarPlayPause
			// 
			this->menuBarPlayPause->AutoSize = false;
			this->menuBarPlayPause->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarPlayPause->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarPlayPause.Image")));
			this->menuBarPlayPause->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarPlayPause->Name = L"menuBarPlayPause";
			this->menuBarPlayPause->Size = System::Drawing::Size(23, 20);
			this->menuBarPlayPause->Text = L"Play/Pause music";
			this->menuBarPlayPause->Click += gcnew System::EventHandler(this, &FormMain::button_play_pause_Click);
			// 
			// menuBarStop
			// 
			this->menuBarStop->AutoSize = false;
			this->menuBarStop->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarStop->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarStop.Image")));
			this->menuBarStop->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarStop->Name = L"menuBarStop";
			this->menuBarStop->Size = System::Drawing::Size(23, 20);
			this->menuBarStop->Text = L"Stop playing/Reset timer";
			this->menuBarStop->Click += gcnew System::EventHandler(this, &FormMain::button_stop_Click);
			// 
			// toolStripSeparator4
			// 
			this->toolStripSeparator4->Name = L"toolStripSeparator4";
			this->toolStripSeparator4->Size = System::Drawing::Size(6, 23);
			// 
			// menuBarAddMusic
			// 
			this->menuBarAddMusic->AutoSize = false;
			this->menuBarAddMusic->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarAddMusic->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarAddMusic.Image")));
			this->menuBarAddMusic->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarAddMusic->Name = L"menuBarAddMusic";
			this->menuBarAddMusic->Size = System::Drawing::Size(23, 20);
			this->menuBarAddMusic->Text = L"Set alarm music..";
			this->menuBarAddMusic->Click += gcnew System::EventHandler(this, &FormMain::SetAlarmMusic_Click);
			// 
			// menuBarSetTime
			// 
			this->menuBarSetTime->AutoSize = false;
			this->menuBarSetTime->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarSetTime->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarSetTime.Image")));
			this->menuBarSetTime->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarSetTime->Name = L"menuBarSetTime";
			this->menuBarSetTime->Size = System::Drawing::Size(23, 20);
			this->menuBarSetTime->Text = L"Set countdown time..";
			this->menuBarSetTime->Click += gcnew System::EventHandler(this, &FormMain::SetCountDownTime_Click);
			// 
			// filename_display
			// 
			this->filename_display->AutoSize = false;
			this->filename_display->AutoToolTip = true;
			this->filename_display->Name = L"filename_display";
			this->filename_display->Size = System::Drawing::Size(154, 20);
			// 
			// menuBarAlarmOnAction
			// 
			this->menuBarAlarmOnAction->AutoSize = false;
			this->menuBarAlarmOnAction->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarAlarmOnAction->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->menuBarPlayMusic, 
				this->menuBarShutdownWindows, this->menuBarLogoffWindows, this->menuBarRebootWindows});
			this->menuBarAlarmOnAction->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarAlarmOnAction->Name = L"menuBarAlarmOnAction";
			this->menuBarAlarmOnAction->Size = System::Drawing::Size(29, 20);
			this->menuBarAlarmOnAction->Text = L"toolStripDropDownButton1";
			// 
			// menuBarPlayMusic
			// 
			this->menuBarPlayMusic->Name = L"menuBarPlayMusic";
			this->menuBarPlayMusic->Size = System::Drawing::Size(168, 22);
			this->menuBarPlayMusic->Text = L"Play Music";
			this->menuBarPlayMusic->Click += gcnew System::EventHandler(this, &FormMain::menuItem_PlayMusic_Click);
			// 
			// menuBarShutdownWindows
			// 
			this->menuBarShutdownWindows->Name = L"menuBarShutdownWindows";
			this->menuBarShutdownWindows->Size = System::Drawing::Size(168, 22);
			this->menuBarShutdownWindows->Text = L"Shutdown Windows";
			this->menuBarShutdownWindows->Click += gcnew System::EventHandler(this, &FormMain::menuItem_ShutDownWindows_Click);
			// 
			// menuBarLogoffWindows
			// 
			this->menuBarLogoffWindows->Name = L"menuBarLogoffWindows";
			this->menuBarLogoffWindows->Size = System::Drawing::Size(168, 22);
			this->menuBarLogoffWindows->Text = L"Logoff Windows";
			this->menuBarLogoffWindows->Click += gcnew System::EventHandler(this, &FormMain::menuItem_LogOffWindows_Click);
			// 
			// menuBarRebootWindows
			// 
			this->menuBarRebootWindows->Name = L"menuBarRebootWindows";
			this->menuBarRebootWindows->Size = System::Drawing::Size(168, 22);
			this->menuBarRebootWindows->Text = L"Reboot Windows";
			this->menuBarRebootWindows->Click += gcnew System::EventHandler(this, &FormMain::menuItem_RestartWindows_Click);
			// 
			// display
			// 
			this->display->BackColor = System::Drawing::Color::Transparent;
			this->display->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
			this->display->ContextMenuStrip = this->timerContextMenu;
			this->display->Cursor = System::Windows::Forms::Cursors::Hand;
			this->display->Font = (gcnew System::Drawing::Font(L"Agency FB", 49.5F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(0)));
			this->display->ForeColor = System::Drawing::Color::Blue;
			this->display->ImageKey = L"(none)";
			this->display->ImageList = this->imageset;
			this->display->Location = System::Drawing::Point(1, 30);
			this->display->Name = L"display";
			this->display->Size = System::Drawing::Size(284, 86);
			this->display->TabIndex = 3;
			this->display->Text = L"00 : 00 : 00";
			this->display->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
			this->tooltips->SetToolTip(this->display, L"Click to set countdown time..");
			this->display->Click += gcnew System::EventHandler(this, &FormMain::SetCountDownTime_Click);
			// 
			// imageset
			// 
			this->imageset->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageset.ImageStream")));
			this->imageset->TransparentColor = System::Drawing::Color::Transparent;
			this->imageset->Images->SetKeyName(0, L"pause.png");
			this->imageset->Images->SetKeyName(1, L"play_continue.png");
			this->imageset->Images->SetKeyName(2, L"play.png");
			this->imageset->Images->SetKeyName(3, L"countdown_timer.png");
			this->imageset->Images->SetKeyName(4, L"background_image.png");
			// 
			// WMPlayer
			// 
			this->WMPlayer->Enabled = true;
			this->WMPlayer->Location = System::Drawing::Point(276, 29);
			this->WMPlayer->Name = L"WMPlayer";
			this->WMPlayer->OcxState = (cli::safe_cast<System::Windows::Forms::AxHost::State^  >(resources->GetObject(L"WMPlayer.OcxState")));
			this->WMPlayer->Size = System::Drawing::Size(10, 37);
			this->WMPlayer->TabIndex = 6;
			this->WMPlayer->Visible = false;
			this->WMPlayer->PlayStateChange += gcnew AxWMPLib::_WMPOCXEvents_PlayStateChangeEventHandler(this, &FormMain::PlayStateChangeEvent);
			// 
			// tab_stopwatch
			// 
			this->tab_stopwatch->BackColor = System::Drawing::SystemColors::Control;
			this->tab_stopwatch->ContextMenuStrip = this->stopwatchContextMenu;
			this->tab_stopwatch->Controls->Add(this->stopwatchMenuBar);
			this->tab_stopwatch->Controls->Add(this->stopwatchDisplay);
			this->tab_stopwatch->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->tab_stopwatch->ImageKey = L"(none)";
			this->tab_stopwatch->Location = System::Drawing::Point(4, 26);
			this->tab_stopwatch->Name = L"tab_stopwatch";
			this->tab_stopwatch->Padding = System::Windows::Forms::Padding(3);
			this->tab_stopwatch->Size = System::Drawing::Size(286, 118);
			this->tab_stopwatch->TabIndex = 1;
			this->tab_stopwatch->Text = L"Stopwatch";
			this->tab_stopwatch->UseVisualStyleBackColor = true;
			// 
			// stopwatchContextMenu
			// 
			this->stopwatchContextMenu->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(5) {this->menuItemStopwatchOptions, 
				this->menuItemStopwatchHelp, this->menuItemStopwatchAbout, this->toolStripSeparator9, this->menuItemStopwatchExit});
			this->stopwatchContextMenu->Name = L"timerContextMenu";
			this->stopwatchContextMenu->Size = System::Drawing::Size(153, 120);
			// 
			// menuItemStopwatchOptions
			// 
			this->menuItemStopwatchOptions->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItemStopwatchOptions.Image")));
			this->menuItemStopwatchOptions->Name = L"menuItemStopwatchOptions";
			this->menuItemStopwatchOptions->Size = System::Drawing::Size(152, 22);
			this->menuItemStopwatchOptions->Text = L"&Options...";
			this->menuItemStopwatchOptions->Click += gcnew System::EventHandler(this, &FormMain::menuItem_Options_Click);
			// 
			// menuItemStopwatchAbout
			// 
			this->menuItemStopwatchAbout->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItemStopwatchAbout.Image")));
			this->menuItemStopwatchAbout->Name = L"menuItemStopwatchAbout";
			this->menuItemStopwatchAbout->Size = System::Drawing::Size(152, 22);
			this->menuItemStopwatchAbout->Text = L"&About...";
			this->menuItemStopwatchAbout->ToolTipText = L"About Gis Simple Timer";
			this->menuItemStopwatchAbout->Click += gcnew System::EventHandler(this, &FormMain::menuItem_About_Click);
			// 
			// toolStripSeparator9
			// 
			this->toolStripSeparator9->Name = L"toolStripSeparator9";
			this->toolStripSeparator9->Size = System::Drawing::Size(149, 6);
			// 
			// menuItemStopwatchExit
			// 
			this->menuItemStopwatchExit->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItemStopwatchExit.Image")));
			this->menuItemStopwatchExit->Name = L"menuItemStopwatchExit";
			this->menuItemStopwatchExit->Size = System::Drawing::Size(152, 22);
			this->menuItemStopwatchExit->Text = L"E&xit";
			this->menuItemStopwatchExit->ToolTipText = L"Exit the program";
			this->menuItemStopwatchExit->Click += gcnew System::EventHandler(this, &FormMain::menuItem_Exit_Click);
			// 
			// stopwatchMenuBar
			// 
			this->stopwatchMenuBar->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left));
			this->stopwatchMenuBar->AutoSize = false;
			this->stopwatchMenuBar->Dock = System::Windows::Forms::DockStyle::None;
			this->stopwatchMenuBar->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(5) {this->menuBarStopwatchPlayPause, 
				this->menuBarStopwatchStop, this->toolStripSeparator5, this->menuBarStopwatchViewLAP, this->menuBarStopwatchCamera});
			this->stopwatchMenuBar->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::Flow;
			this->stopwatchMenuBar->Location = System::Drawing::Point(0, 1);
			this->stopwatchMenuBar->Name = L"stopwatchMenuBar";
			this->stopwatchMenuBar->RenderMode = System::Windows::Forms::ToolStripRenderMode::System;
			this->stopwatchMenuBar->Size = System::Drawing::Size(285, 23);
			this->stopwatchMenuBar->TabIndex = 16;
			// 
			// menuBarStopwatchPlayPause
			// 
			this->menuBarStopwatchPlayPause->AutoSize = false;
			this->menuBarStopwatchPlayPause->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarStopwatchPlayPause->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarStopwatchPlayPause.Image")));
			this->menuBarStopwatchPlayPause->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarStopwatchPlayPause->Name = L"menuBarStopwatchPlayPause";
			this->menuBarStopwatchPlayPause->Size = System::Drawing::Size(23, 20);
			this->menuBarStopwatchPlayPause->Text = L"Play/Pause";
			this->menuBarStopwatchPlayPause->Click += gcnew System::EventHandler(this, &FormMain::stopwatch_start_pause_Click);
			// 
			// menuBarStopwatchStop
			// 
			this->menuBarStopwatchStop->AutoSize = false;
			this->menuBarStopwatchStop->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarStopwatchStop->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarStopwatchStop.Image")));
			this->menuBarStopwatchStop->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarStopwatchStop->Name = L"menuBarStopwatchStop";
			this->menuBarStopwatchStop->Size = System::Drawing::Size(23, 20);
			this->menuBarStopwatchStop->Text = L"Reset Stopwatch (will clear all lap records)";
			this->menuBarStopwatchStop->Click += gcnew System::EventHandler(this, &FormMain::stopwatch_stop_Click);
			// 
			// toolStripSeparator5
			// 
			this->toolStripSeparator5->Name = L"toolStripSeparator5";
			this->toolStripSeparator5->Size = System::Drawing::Size(6, 23);
			// 
			// menuBarStopwatchViewLAP
			// 
			this->menuBarStopwatchViewLAP->AutoSize = false;
			this->menuBarStopwatchViewLAP->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarStopwatchViewLAP->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarStopwatchViewLAP.Image")));
			this->menuBarStopwatchViewLAP->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarStopwatchViewLAP->Name = L"menuBarStopwatchViewLAP";
			this->menuBarStopwatchViewLAP->Size = System::Drawing::Size(23, 20);
			this->menuBarStopwatchViewLAP->Text = L"View LAPs";
			this->menuBarStopwatchViewLAP->Click += gcnew System::EventHandler(this, &FormMain::stopwatchShowLAP_Click);
			// 
			// menuBarStopwatchCamera
			// 
			this->menuBarStopwatchCamera->AutoSize = false;
			this->menuBarStopwatchCamera->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
			this->menuBarStopwatchCamera->Enabled = false;
			this->menuBarStopwatchCamera->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuBarStopwatchCamera.Image")));
			this->menuBarStopwatchCamera->ImageTransparentColor = System::Drawing::Color::Magenta;
			this->menuBarStopwatchCamera->Name = L"menuBarStopwatchCamera";
			this->menuBarStopwatchCamera->Size = System::Drawing::Size(23, 20);
			this->menuBarStopwatchCamera->Text = L"Capture LAP";
			this->menuBarStopwatchCamera->Click += gcnew System::EventHandler(this, &FormMain::stopwatchCatch_Click);
			// 
			// stopwatchDisplay
			// 
			this->stopwatchDisplay->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
			this->stopwatchDisplay->Cursor = System::Windows::Forms::Cursors::Hand;
			this->stopwatchDisplay->Font = (gcnew System::Drawing::Font(L"Agency FB", 50));
			this->stopwatchDisplay->ForeColor = System::Drawing::Color::Blue;
			this->stopwatchDisplay->ImageList = this->imageset;
			this->stopwatchDisplay->Location = System::Drawing::Point(1, 30);
			this->stopwatchDisplay->Name = L"stopwatchDisplay";
			this->stopwatchDisplay->Size = System::Drawing::Size(284, 86);
			this->stopwatchDisplay->TabIndex = 0;
			this->stopwatchDisplay->Text = L"00:00:00.0";
			this->stopwatchDisplay->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
			this->stopwatchDisplay->Click += gcnew System::EventHandler(this, &FormMain::stopwatch_start_pause_Click);
			// 
			// tooltips
			// 
			this->tooltips->AutomaticDelay = 2000;
			this->tooltips->AutoPopDelay = 2000;
			this->tooltips->InitialDelay = 2000;
			this->tooltips->ReshowDelay = 1000;
			this->tooltips->Tag = L"";
			// 
			// notifyIcon
			// 
			this->notifyIcon->ContextMenuStrip = this->timerContextMenu;
			this->notifyIcon->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"notifyIcon.Icon")));
			this->notifyIcon->Visible = true;
			this->notifyIcon->MouseClick += gcnew System::Windows::Forms::MouseEventHandler(this, &FormMain::ShowTimer_MouseClick);
			// 
			// watchTimer
			// 
			this->watchTimer->Tick += gcnew System::EventHandler(this, &FormMain::StopwatchTimer_Tick);
			// 
			// menuItemStopwatchHelp
			// 
			this->menuItemStopwatchHelp->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"menuItemStopwatchHelp.Image")));
			this->menuItemStopwatchHelp->Name = L"menuItemStopwatchHelp";
			this->menuItemStopwatchHelp->Size = System::Drawing::Size(152, 22);
			this->menuItemStopwatchHelp->Text = L"&Help";
			this->menuItemStopwatchHelp->Click += gcnew System::EventHandler(this, &FormMain::menuItem_help_Click);
			// 
			// FormMain
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(294, 148);
			this->Controls->Add(this->tabControl);
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
			this->MaximizeBox = false;
			this->MinimizeBox = false;
			this->Name = L"FormMain";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Move += gcnew System::EventHandler(this, &FormMain::TestWindowStateChanged_Event);
			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &FormMain::OverWriteFormCloseButton_Event);
			this->timerContextMenu->ResumeLayout(false);
			this->tabControl->ResumeLayout(false);
			this->tab_timer->ResumeLayout(false);
			this->timerMenuBar->ResumeLayout(false);
			this->timerMenuBar->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->WMPlayer))->EndInit();
			this->tab_stopwatch->ResumeLayout(false);
			this->stopwatchContextMenu->ResumeLayout(false);
			this->stopwatchMenuBar->ResumeLayout(false);
			this->stopwatchMenuBar->PerformLayout();
			this->ResumeLayout(false);

		}
#pragma endregion

	public:
		void SetLanguages();
		void LoadSettings();
		void SetDisplayCustomBackgroundImage(String ^imagePath,JPTimer timer);
		void SetDisplayDefaultBackgroundImage(JPTimer timer);
		void SetDisplayNoneBackgroundImage(JPTimer timer);
		//Check if the path to music file is valid or not
		//Load the path to player if valid
		void ValidateMusicPathAndLoadToPlayer(String ^path);
		int GetStartCount(){ return startCount;}

	private:
		// Event raised when alarm on (timeout)
		void AlarmOnActioning(void);
		void TimeUpFlashing();
		void StopTimerAndStopFlashing(bool stopPlayer);

		//Capture the current time and store in timeStamp
		void CaptureTimeStamp();
		//Print a time stamp on label_timeStamp
		void PrintTimeStamp();
		//Capture the current time and print it
		void UpdateTimeStamp();

		void EnableDisableFilenameDisplay();
		void EnableDisableCountingDown();
		//Set alarm-on action menu items Checked status depend on the alarmOnAction variable
		void ResetAlarmOnActionMenuItems();
		void UpdateAlarmOnActionMenuItemsLanguages();
		void SaveAlarmMusicPathToSettings(String ^path);
		void InitializeReusableImages(void);
		void LoadCustomLayoutValues(TimerSettings ^settings);

		System::Void timer_Tick(System::Object^  sender, System::EventArgs^  e) {
			 if(countdownSeconds){
				 --countdownSeconds;
				 UpdateCountdownDisplay();
			 }
			 else{
				 if(flashing == 0) AlarmOnActioning();
				 else TimeUpFlashing();
			 }
		}

		void UpdateCountdownDisplay()
		{
			display->Text = String::Format("{0:00} : {1:00} : {2:00}",
				countdownSeconds/3600,
				(countdownSeconds%3600)/60,
				countdownSeconds%60);
		}

		//When the time-display was clicked, show timeSelector dialog window
		System::Void SetCountDownTime_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_About_Click(System::Object^  sender, System::EventArgs^  e);

		System::Void SetAlarmMusic_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void button_play_pause_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void button_stop_Click(System::Object^  sender, System::EventArgs^  e);

		 //Change the image displayed in the PlayPauseButton and
		 //Ensure buttons display correct symbols when a song reaches the end
		System::Void PlayStateChangeEvent(System::Object^  sender, AxWMPLib::_WMPOCXEvents_PlayStateChangeEvent^  e);

		System::Void menuItem_StopCountdown_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_Options_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_ShowAlarmMusicInfo_Click(System::Object^  sender, System::EventArgs^  e);

		//Set alarm-on actions
		System::Void menuItem_PlayMusic_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_ShutDownWindows_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_LogOffWindows_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_RestartWindows_Click(System::Object^  sender, System::EventArgs^  e);

		/**************************Stopwatch************************/
		void StopwatchTimer_Tick(System::Object^ sender, System::EventArgs ^e)
		{
			swtime = stopWatch->Elapsed;
			stopwatchDisplay->Text = String::Format("{0:00}:{1:00}:{2:00}.{3}",
				swtime.Hours,
				swtime.Minutes,
				swtime.Seconds,
				swtime.Milliseconds/100);
		}

		void StopwatchStart();
		void StopwatchPause();
		void StopwatchReset();

		System::Void stopwatch_start_pause_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void stopwatch_stop_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void stopwatchCatch_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void stopwatchShowLAP_Click(System::Object^  sender, System::EventArgs^  e);
		/**************************Stopwatch************************/

		System::Void menuItem_Exit_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void TestWindowStateChanged_Event(System::Object^  sender, System::EventArgs^  e);
		System::Void ShowTimer_Event(System::Object^ sender, System::EventArgs^ e);

		System::Void ShowTimer_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e);
		System::Void OverWriteFormCloseButton_Event(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e);
		System::Void DragAndDropInMusicFile_Event(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
		System::Void AllowDragDrop_DragEnter(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
		System::Void tabTimer_MouseEnterEvent(System::Object^  sender, System::EventArgs^  e);
		System::Void tabTimer_MouseLeaveEvent(System::Object^  sender, System::EventArgs^  e);
		System::Void menuItem_help_Click(System::Object^  sender, System::EventArgs^  e);
};
}

